import { BaseWindow } from "../../../../component/window/BaseWindow";
import { ILayer } from "../../../../mvc/interfaces/ILayer";
import { Language } from "../../../../../extend/language/Language";
import { SRobCityTwoRanks } from "../../../../../Message/Public/SRobCityTwoRanks";
import { ObjCreate } from "../../common/ObjCreate";
import { KingChampionShipResultTab1 } from "./subWin/KingChampionShipResultTab1";
import { KingChampionShipResultTab2 } from "./subWin/KingChampionShipResultTab2";
import { MuiEvent } from "../../../../../com/mui/events/MuiEvent";
import { GameProxy } from "../../../mvc/GameProxy";
import { DisplayUtil } from "../../../../common/DisplayUtil";
import { GTabBar } from "../../../../../com/mui/controls/GTabBar";
type int = number;
//class KingChampionShipResultWin
    
    export  class KingChampionShipResultWin extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            this.setSize(453, 482);
            this.title = Language.getString(80379);
            this.titleHeight = 24;
            return;
        }

        public setData1(arg1: Array<any>): void
        {
            this._subWin1.setDatas(arg1);
            return;
        }

        public setData2(arg1: SRobCityTwoRanks): void
        {
            this._subWin2.setDatas(arg1);
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            this._tab = ObjCreate.createGTabBar(25, 35, Language.getArray(80407), 70, 20, this);
            ObjCreate.createBg(16, 57, 422, 414, this);
            this._subWin1 = new KingChampionShipResultTab1();
            this._subWin1.x = 18;
            this._subWin1.y = 61;
            this._subWin2 = new KingChampionShipResultTab2();
            this._subWin2.x = 18;
            this._subWin2.y = 61;
            this._tab.addEventListener(MuiEvent.GTABBAR_SELECTED_CHANGE, this.tabChangeHandler);
            this.changeToIndex(0);
            return;
        }

        /* internal  */tabChangeHandler(arg1: MuiEvent): void
        {
            var loc1=this._tab.selectedIndex;
            this.changeToIndex(loc1);
            if (loc1 == 1) 
            {
                GameProxy.robCityProxy.getKingChampionShipRank(1, 10, 1, false);
            }
            return;
        }

        public changeToIndex(arg1: int=0): void
        {
            this._tab.selectedIndex = arg1;
            if (arg1 != 0) 
            {
                this.addChild(this._subWin2);
                DisplayUtil.removeMe(this._subWin1);
            }
            else 
            {
                this.addChild(this._subWin1);
                DisplayUtil.removeMe(this._subWin2);
            }
            return;
        }

        /* internal */ /* var */_tab: GTabBar;

        /* internal */ /* var */_subWin1: KingChampionShipResultTab1;

        /* internal */ /* var */_subWin2: KingChampionShipResultTab2;
    }
